--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Node / ReticulumProjects / MeshChatX.git / files / docs / agents / skills / electron-frozen-packaging / SKILL.md
docs/agents/skills/electron-frozen-packaging/SKILL.md 37edfa4cfe5aa2f6ebb7e4aeac2e2c67ad181a52 (37edfa4c) Text, 2.20 KB
Skill: electron-frozen-packaging
Package and recover the desktop shell correctly: frozen subprocess re-entry, loading probes, crash/offline DB restore, and external URL guards.
When to use
• Changing Electron main process, backend spawn, or close / tray behaviour
• Spawning bots, rnsh, LXMFy, or other Python helpers from a packaged build
• Touching crash screens, offline recovery, or external link opening
Frozen executable rules
• In frozen builds, T383838sys.executable is MeshChatX.
• Never spawn T383838python -m … or T383838python -c … for bots, rnsh, LXMFy, or self-check probes from the packaged app.
• Use T383838--meshchatx-run-module <module> so helpers re-enter the same binary without launching a second full app (storage lock collision).
• On Windows, Electron can start the backend through T383838--meshchatx-run-module meshchatx.src.backend.appcontainer_launcher when T383838MESHCHAT_APPCONTAINER=1. The launcher CreateProcess-es the real backend into an LPAC AppContainer. Orphan kill must use process-tree termination (T383838taskkill /T) so both launcher and child exit. Default is off (direct backend spawn).
Loading and navigation
• Loading shell probes T383838/api/v1/status. T383838starting is valid for early navigation (see T383838deferred-network-startup).
• T383838will-navigate / T383838safeExternalUrl send http(s) to the OS browser. Do not replace the app window with external sites.
• Close behaviour (quit / tray / ask) persists per user choice. Guard re-entrancy on close.
Crash / offline recovery
• Crash UI can list backups under T383838database-backups/ and T383838snapshots/.
• Prefer newest non-T383838SUSPICIOUS backup.
• Relaunch paths may pass T383838--auto-recover / T383838--emergency.
Key files
• T383838electron/main.js
• T383838electron/backendProcess.js
• T383838electron/loadingStatusProbe.js
• T383838electron/offlineRecovery.js
• T383838electron/closeBehavior.js
• T383838electron/safeExternalUrl.js
• T383838meshchatx/meshchat.py (T383838--meshchatx-run-module)
Verification
T282828
uv run pytest tests/backend/test_meshchatx_run_module.py -q --tbTff7b72=short
pnpm Tffa657exec vitest run tests/electron/ --passWithNoTests T79c0ff2>/dev/null Tff7b72|| Tffa657true
Prefer focused Electron unit tests under T383838tests/electron/ when present for the touched module.
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────